class Observable:
    def __init__(self, initialValue=None):
	print 'init observable'
        self.data = initialValue
        self.callbacks = {}

    def addCallback(self, func):
	print 'addcallback observable'
        self.callbacks[func] = 1

    def delCallback(self, func):
	print 'delcallback observable'
        del self.callback[func]

    def _docallbacks(self):
        for func in self.callbacks:
	    print '_docallbacks for observable'
            func(self.data)

    def set(self, data):
	print 'set observable'
        self.data = data
        self._docallbacks()

    def get(self):
	print 'get observable'
        return self.data

    def unset(self):
	print 'unset observable'
        self.data = None


class Model:
    def __init__(self):
        self.myMoney = Observable(0)

    def addMoney(self, value):
        self.myMoney.set(self.myMoney.get() + value)

    def removeMoney(self, value):
        self.myMoney.set(self.myMoney.get() - value)

    def mMoney(self):
	self.myMoney.set(- self.myMoney.get())
